package com.credit.management.system.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.credit.management.system.custom.dao.CCompanyMapper;
import com.credit.management.system.generator.dao.CompanyMapper;
import com.credit.management.system.jdbc.dao.CompanyDao;
import com.credit.management.system.model.Company;
import com.credit.management.system.model.Page;
import com.credit.management.system.service.ICompanyService;
@Service
public class CompanyService implements ICompanyService {
	@Autowired
	private CCompanyMapper cCompanyMapper;
	@Autowired
	private CompanyMapper companyMapper;
	@Autowired
	private CompanyDao companyDao;
	
	/***
	 * 删除
	 */
	@Override
	public int deleteByPrimaryKey(Integer id) {
		
		return companyMapper.deleteByPrimaryKey(id);
	}
	
	/**
	 * 添加
	 */
	@Override
	public int insertSelective(Company record) {
		
		return companyMapper.insertSelective(record);
	}
	
	/**
	 * 根据id查询
	 */
	@Override
	public Company selectByPrimaryKey(Integer id) {
		
		return companyMapper.selectByPrimaryKey(id);
	}
	
	/**
	 * 根据id修改
	 */
	@Override
	public int updateByPrimaryKeySelective(Company record) {
		
		return companyMapper.updateByPrimaryKeySelective(record);
	}
	
	/**
	 * 分页Company
	 */
	@Override
	public Page findPageCompany(Page page) {
		
		return companyDao.findPageCompany(page);
	}
	/**
	 * 全查companys
	 */
	@Override
	public List<Map<String, Object>> findAllCompanys() {
		
		return cCompanyMapper.findAllCompanys();
	}
}
